<template>
  <div id="detail-goods-info" v-if="Object.keys(detailInfo).length>1">
    <div class="goods-info-desc">
      <div style="float:left" class="desc-line">
        <i class="desc-dot"></i>
      </div>
      <div class="desc-text">{{ detailInfo.desc }}
        <div style="float:right" class="desc-line">
          <i class="desc-dot" style="right:0px"></i>
        </div>
      </div>
      <div class="goods-info-key">
        {{ detailInfo.detailImage[0].key }}
      </div>
      <div class="goods-info-images">
        <img :src="item" alt="" v-for="(item,index) of detailInfo.detailImage[0].list" :key="index" @load="imageLoaded">
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "GoodsInfo",
  props: {
    detailInfo: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  methods: {
    imageLoaded() {
      this.$emit('imageLoaded');
    }
  }
}
</script>

<style scoped>
#detail-goods-info {
  font-size: 0.68rem;
}

.goods-info-desc {
  font-size: 0.6rem;
  padding: 0.42rem 0.34rem;
}

.desc-line {
  width: 3.5rem;
  height: 0.04rem;
  background-color: gray;
  position: relative;
}

.desc-dot {
  position: absolute;
  top: -0.1rem;
  display: inline-block;
  width: 0.21rem;
  height: 0.21rem;
  background-color: black;
  border-radius: 50%;
}

.desc-text {
  padding: 0.85rem 0;
  color: gray;
}

.goods-info-key {
  padding: 0.42rem 0.34rem;
}

.goods-info-images img {
  width: 100%;
}
</style>
